package cn.com.support.utils;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * ApplictionContextUtil获取ApplicationContext
 * 
 * @author Microbun 2012-2-13上午3:59:28
 * @version $Id: ApplictionContextUtil.java 120 2012-03-19 13:15:55Z Microbun $
 * @since 1.0
 */
@Component
public class ApplictionContextUtil implements ApplicationContextAware {

	private static ApplicationContext applicationContext;

	@Override
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		ApplictionContextUtil.applicationContext = applicationContext;
	}

	public static ApplicationContext getApplicationContext() {
		return applicationContext;
	}

}
